package com.ojoin.trade.supplyloan_core.web.service.impl;

import com.ojoin.trade.common.exception.BusinessException;
import com.ojoin.trade.common.web.dao.BaseDao;
import com.ojoin.trade.common.web.service.impl.BaseServiceImpl;
import com.ojoin.trade.supplyloan_core.web.dao.TbSlBankaccDao;
import com.ojoin.trade.supplyloan_core.web.domain.TbSlBankacc;
import com.ojoin.trade.supplyloan_core.web.service.TbSlBankaccService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 16-1-8
 * Time: 下午5:31
 * To change this template use File | Settings | File Templates.
 */
@Service
public class TbSlBankaccServiceImpl extends BaseServiceImpl<TbSlBankacc> implements TbSlBankaccService {

    @Autowired
    private TbSlBankaccDao dao;
    @Override
    protected BaseDao<TbSlBankacc> getBaseDao() {
        return dao;  //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public List<TbSlBankacc> queryBankaccByJoinid(int idOfTbMerchantUser) throws BusinessException {
        return ((TbSlBankaccDao)getBaseDao()).queryBankaccByJoinid(idOfTbMerchantUser);  //To change body of implemented methods use File | Settings | File Templates.
    }

    @Override
    public int insertBankacc(TbSlBankacc vo) throws BusinessException {
        getBaseDao().insert(vo);
        return vo.getId();  //To change body of implemented methods use File | Settings | File Templates.
    }
}
